package com.wsb.service;

import com.wsb.dao.SmbmsUserDao;
import com.wsb.entry.SubmsUser;

import javax.servlet.http.HttpSession;
import java.sql.*;

public class LoginService {
    public boolean login(String userName, String userPassword){
        try{
            SmbmsUserDao smbmsUserDao= new SmbmsUserDao();
            SubmsUser smbmsUser =smbmsUserDao.getSmbmUserByUserName(userName);
            if(smbmsUser!=null){
                if(smbmsUser.getUserPassword().equals(userPassword)){
                    return true;
                }else {
                    return false;
                }

            }else{
                return false;
            }
        }catch(Exception e){
            e.printStackTrace();
        }
        return false;
    }
    }
